import Taro, {Component, Config} from '@tarojs/taro'
import {View} from "@tarojs/components";
import { IndexBanner, ShopList } from '../../components/index'
import img1 from '../../asssets/images/index/banner0.png'
import shop from '../../asssets/images/index/shop1.jpg'
import './index.less'

export default class Index extends Component {
  config: Config = {
    navigationBarTitleText: '首页',
    navigationBarBackgroundColor: "#fe7a9b",
    navigationBarTextStyle: "white",
    backgroundColor: "#eeeeee",
    backgroundTextStyle: "light",
    enablePullDownRefresh: true
  }
  constructor() {
    super()
    this.state = {
      data: 'wwww',
      bannerList: [
        {id: 0, img: img1},
        {id: 1, img: img1},
        {id: 2, img: img1},
      ],
      shopListData:[
        {id: 0, img: shop, info: '169'},
        {id: 1, img: shop, info: '169'},
        {id: 2, img: shop, info: '169'},
        {id: 3, img: shop, info: '169'},
        {id: 4, img: shop, info: '169'},
        {id: 5, img: shop, info: '169'},
        {id: 6, img: shop, info: '169'}
      ]
    }
  }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmout () { }

  componentDidShow () { }

  componentDidHide () { }

  render () {
    return (
      <View className='index-warp'>
        <IndexBanner data={this.state.bannerList}  test={this.state.data}></IndexBanner>
        <View className='shops-wrap'>
          <View className='tips'>这是公告内容</View>
          <View className='shop-list'>
            <ShopList data={this.state.shopListData} ></ShopList>
          </View>
        </View>
      </View>
    )
  }
}
